package com.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.dao.UserDAO;
import com.pojo.User;
import com.service.UserService;

@Service
public class UserLoginServiceImpl implements UserService {
	@Autowired
	UserDAO userDao;

	public User verify(User user) {
		User userData = userDao.findUserByName(user.getUsername());
		if (userData != null
				&& user.getPassword().equals(userData.getPassword())) {
			return userData;
		} else {
			return null;
		}
	}

}
